package com.pattern.practice.observer;

import cn.hutool.core.lang.Console;

public class Panel2 implements Observer, DisplayElement {
    private int age;
    private int weight;

    public Panel2(Subject subject) {
        subject.registerObserver(this);
    }

    @Override
    public void display() {
        Console.log("panel2", age, weight);
    }

    @Override
    public void update(int age, int weight) {
        this.age = age;
        this.weight = weight;
        display();
    }
}
